@grid-columns: 24;

.i-col {
    float: left;
    box-sizing: border-box;
    width: 0;
}

.generate-columns(@grid-columns, @index: 1) when (@index =< @grid-columns) {
    .i-col-span-@{index} {
        display: block;
        width: percentage((@index / @grid-columns));
    }
    .i-col-offset-@{index} {
        margin-left: percentage((@index / @grid-columns));;
    }

    .generate-columns(@grid-columns, (@index + 1));
}

.generate-columns(@grid-columns);